/**
 * 获取authCode
 */
export function getAuthCode({ scopes }: any = { scopes: "auth_base"}) {
  return new Promise((resolve, reject) => {
    my.getAuthCode({
      scopes,
      success: res => {
        console.log('getAuthCode::success:', res);
        if (res && res.authCode) {
          resolve(res.authCode);
        } else {
          reject(res);
        }
      },
      fail: err => {
        console.log('getAuthCode::fail:', err);
        reject(err);
      }
    });
  });
}